export default {
  functional: true,
  render(h, context) {
    context.data._isRouterView = true
    let depth = 0,
      parent = context.parent
    while (parent) {
      if (parent.$vnode?.data._isRouterView) {
        depth++
      }
      parent = parent.$parent
    }
    const route = context.parent._routerRoot._route.route
    const record = route[depth]
    return record ? h(record, context.data) : h()
  }
}
